<template>
	<view 
		class="job-item margin-bottom-sm padding" 
		:class="cType" 
		@click="handleDetail"
	>
	    <view class="flex align-center justify-between">
	        <view  class="flex align-center company-info">
	            <image class="margin-right-sm" :src="jobdata.brandLogo"></image>
	            <text class="text-grey">{{jobdata.brandName}}</text>
	        </view>
	        <text class="iconfont icon-bookmark-o"></text>
	    </view>
	    <view class="margin-tb-sm text-lg">{{jobdata.jobName}}</view>
	    <view class="text-grey margin-bottom-sm">
			{{jobdata.cityName}} · {{jobdata.areaDistrict}}
			<text class="text-orange" v-if="cType=='new'"> · {{jobdata.salaryDesc}}</text>
		</view>
	    <view class=" text-orange" v-if="cType=='hot1'">{{jobdata.salaryDesc}}</view>
		<view class="margin-top-sm" v-if="cType=='new'">
			<text class="cu-tag margin-bottom-xs margin-right-xs" v-for="welfare in jobdata.welfareList">{{welfare}}</text>
		</view>
	    <view class="flex margin-top-sm">
	        <view class="margin-right">
	            <text class="iconfont icon-renqun"></text>
	            80
	        </view>
	        <view>
	            <text class="iconfont icon-browse"></text>
	            300
	        </view>
	    </view>
	</view>
</template>

<script>
	export default {
		name:"company-job-item",
		props: {
			cType: {
				type: String,
				default:'hot1', //hot1热门岗位  new 最新  hot2热门公司
				validator(value){ //自定义验证函数
					return ['hot1','hot2','new'].includes(value)
				}
			},
			jobdata:{
				type:Object,
				required:true
			}
		},
		data() {
			return {
				
			};
		},
		created() {
			console.log('组件的created');
		},
		methods: {
			handleDetail() {
				uni.navigateTo({
					url:'/pages/job-detail/job-detail?id='+this.jobdata.objectId
				})
			}
		},
	}
</script>

<style>
.job-item{
    flex-shrink: 0;
    /* height: 336upx; */
    border: 1px solid rgba(238, 238, 238, 1);
}
.hot1{
	width: 344upx;
}
.new{
	margin:20upx
}
.job-item image{
    height: 40upx;
    width: 40upx;
}
.company-info{
    max-width: 80%;
}
.cu-tag{
	margin-left: 0;
}
</style>